new Vue({
    el: "#app",
    data: {
        pageData: [],
        queryParms: {
            Name: ""
        },
        pageDataUrl: "SysMenu/pageListData"
    },
    methods: {
        onSearch() {
            this.$refs.tableService.loadData();
        },
        onDataChange(data) {
            this.pageData = data;
        },
        onAdd() {
            location.href = "MenuEdit.html";
        },
        onEdit(id) {
            location.href = "MenuEdit.html?id=" + id;
        },
        onDelete(ids) {
            var _this = this;
            if (ids.length <= 0) {
                _this.$Message.error("请选择要删除的数据");
                return;
            }
            $http.delete("SysMenu/delete", { Ids: ids }, function (state) {
                _this.$refs.tableService.loadData();
                return true;
            });
        },
        onDeleteAll() {
            var ids = this.$refs.table.getSelection().map(x => x.ID);
            this.onDelete(ids);
        },
        onDeleteSingle(id) {
            this.onDelete([id]);
        }
    }
})